from starlette.endpoints import HTTPEndpoint
from starlette.responses import JSONResponse
from model.ModPhotoIndex import PhotoIndex,photoIndexSchema
from database import Session, engine
import datetime


def get_photo_info(session,photo_fingerprint: str):
    #查询图片信息
        photo_info = session.query(PhotoIndex).filter(PhotoIndex.photo_fingerprint == photo_fingerprint).one_or_none()
        return JSONResponse(photoIndexSchema.dump(photo_info, many=False).data)